package com.atguigu.keyword;

public class Sub extends Base{
    int a = 2;
    int c = 2;

    public void printA(){
        System.out.println("a = " + a);
        System.out.println("super.a = " + super.a);
    }
    public void showA(int a){
        System.out.println("a = " + a);
        System.out.println("this.a = " + this.a);//局部变量与成员变量重名时，在成员变量前面加this.
        System.out.println("super.a = " + super.a);//子类成员变量与父类成员变量重名是，在父类的成员变量前面加super.
    }

    public void printB(){
        System.out.println("b = " + b);
        System.out.println("b = " + this.b);
        System.out.println("super.b = " + super.b);
    }

    public void printC(){
        System.out.println("c = " + c);
        System.out.println("c = " + this.c);
//        System.out.println("super.c = " + super.c);
    }
    public void method(){
        super.method();
    }
}
